<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
  <link rel="stylesheet" href="../../static/BOSGeo/BOSGeo.css" />
  <title>添加html</title>
  <style>
    html {
      font-size: 12px;
    }

    html,
    body,
    #mapContainer {
      height: 100%;
      width: 100%;
      padding: 0;
      margin: 0;
    }

  </style>
</head>

<body>
  <div id="mapContainer"></div>
  <script src="../../static/BOSGeo/BOSGeo.js"></script>
  <script>
    var map = new BOSGeo.Map('mapContainer', {
    mapType: BOSGeo.TDT_IMAGERY
    });

    var layers = map.layers;
    var primitiveCollection = new BOSGeo.LayerCollection({
    name: 'primitive图形集合',
    type: 'primitive'
    });
    layers.add(primitiveCollection);

    var combine = new BOSGeo.PrimitiveCombineLayer({
    name: '组合图形',
    data: [
        {
            type: 'polygon',
            position: [121.46325, 31.16363, -0, 121.46441, 31.16479, 0, 121.4658, 31.16422, 0, 121.46542, 31.16312, 0, 121.4643, 31.163, 0],
            color: '#f96a4e',
            height: 10,
        },
        {
            type: 'rect',
            position: [121.46308, 31.16141, 0, 121.46707, 31.16026, 0],
            color: '#f96a4e',
            height: 30,
        },
        {
            type: 'ellipse',
            position: [121.46986, 31.16306, 0],
            color: '#f96a4e',
            radius: 50,
            height: 20,
        }
    ],
    onClick: layer => {
        // layer.zoomTo();
    }
    });
    primitiveCollection.add(combine);
    // combine.setVisible(false); // 隐藏组合图形
    
    map.viewFix(121.4658, 31.16493, 1000, {
    heading: 283.40944,
    pitch: -84.58174,
    roll: 178.23488
    })
  </script>
</body>

</html>